package com.fs.ibox_h.dao.impl;

import com.fs.ibox_h.dao.adminDao;
import com.fs.ibox_h.pojo.admin;
import com.fs.ibox_h.util.JDBCUtil;

import java.util.List;

public class adminDaoImpl implements adminDao {
    @Override
    public admin queryByUsernameAndPwd(String username, String password) {
        String sql = "SELECT * FROM tb_admin WHERE admin=? and apassword=?";
        List<admin> admins = JDBCUtil.executeQuery(sql, admin.class, username, password);
        return admins!=null && !admins.isEmpty() ? admins.get(0) : null;
    }


}
